//
// Created by liushuai on 18-9-12.
//

#include <bits/stdc++.h>
using namespace std;
int main()
{
    string a;
    cin>>a;
    vector<char> ch;
    vector<int> count;
    for(auto e:a)
    {
        if(ch.size() == 0)
        {
            ch.push_back(e);
            count.push_back(1);
        } else
        {
            int i;
            for(i =0;i<ch.size();i++)
            {
                if(e == ch[i])
                {
                    count[i]++;
                    break;
                }

                else
                    continue;

            }
            if(i == ch.size())
            {
                ch.push_back(e);
                count.push_back(1);
            }
        }
    }
    int i;
    for(i = count.size()-1;i>=0;i--)
    {
        if(count[i]==1)
        {
            cout<<ch[i];
            break;
        }
    }
    if(i<0)
        cout<<"NULL";

}